<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/6/21
 * Time: 下午9:28
 */


//创建一个包含变量与其值的数组。

$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";

$location_vars = array("city", "state");

$result = compact("event", "nothing_here", $location_vars);
print_r($result);


$localVariables = compact(array_keys(get_defined_vars()));
//print_r($localVariables);


print_r(compact('result'));


$arr = [
    1 => "one"
];
extract($arr);

print $one;